import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/ruoyi";



// // 查询文件下拉树结构
// export function fileTreeSelect() {
//     return request({
//       url: '/zhishiku/file/fileTree',
//       method: 'get'
//     })
//   }

// 查询所有文件下拉树结构
export function allfileTreeSelect() {
  return request({
    url: '/zhishiku/file/allfileTree',
    method: 'get'
  })
}  

//文件/文件夹上传
export function uploadFiles(data) {
  return request({
    url: '/zhishiku/file/upload',
    method: 'post',
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
    data: data
  })
}

// 获取文件展示列表
export function getfileList(data) {
  return request({
    url: '/zhishiku/file/list',
    method: 'post',
    data: data
  })
}


// 创建文件夹
export function createFolder(data) {
  return request({
    url: '/zhishiku/file/createFolder',
    method: 'post',
    data: data
  })
}

//获取文件子集
export function getChildren(id) {
  return request({
    url: '/zhishiku/file/getChildren/'+id,
    method: 'get'
  })
}


 // 删除文件/文件夹
 export function deleteFile(id) {
  return request({
    url: '/zhishiku/file/delete/'+id,
    method: 'delete',
  })
}

//校验文件权限
export function checkPremission(id,auth) {
  return request({
    url: '/zhishiku/file/checkPremission/'+id+'/'+auth,
    method: 'get',
  })
}

// 文件重命名接口
export function renameFile(params) {
  console.log("console.log(data)")
  console.log(params)
  return request({
    url: '/zhishiku/file/rename',
    method: 'post',
    params: params
  })
  
}
